import Vue from 'vue'
import Vuex from 'vuex'
import app from './modules/app'
import user from './modules/user'
import select from './modules/select'
import tagsView from './modules/tagsView'
import permission from './modules/permission'
import settings from './modules/settings'
import dict from './modules/dict'
import uploads from './modules/uploads'
import uploadsOuter from './modules/uploadsOuter'
import getters from './getters'

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    // nodeMap: new Map(),
    // formItemMap: new Map(),
    // isEdit: null,
    // loginUser: JSON.parse(localStorage.getItem('loginUser') || '{}'),
    // selectedNode: {},
    // selectFormItem: null,
    // design:{},
  },
  mutations: {
    // selectedNode(state, val) {
    //   state.selectedNode = val
    // },
    // loadForm(state, val){
    //   state.design = val
    // },
    // setIsEdit(state, val){
    //   state.isEdit = val
    // }
  },
  // getters: {},
  actions: {},
  // modules: {},
  modules: {
    app,
    user,
    select,
    tagsView,
    permission,
    settings,
    dict,
    uploads,
    uploadsOuter
  },
  getters
})

export default store
